<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>vexpseg</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="vexp_i.html" title="vexp_i" />
    <link rel="next" href="vexpv.html" title="vexpv" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">vexpseg</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="vexp_i.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="vexpv.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="vexpseg"></a>
      <div class="titlepage"></div>
      <a id="IndexVexpseg" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">vexpseg</span>
        </h2>
        <p>vexpseg — 
      Vectorial envelope generator
    </p>
      </div>
      <div class="refsect1">
        <a id="idp164067120"></a>
        <h2>Description</h2>
        <p>
      Generate exponential vectorial segments
    </p>
      </div>
      <div class="refsect1">
        <a id="idp164068336"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>vexpseg</strong></span>  ifnout, ielements, ifn1, idur1, ifn2 [, idur2, ifn3 [...]]</pre>
      </div>
      <div class="refsect1">
        <a id="idp164070352"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifnout</em></span> - number of table hosting output vectorial signal
      </p>
        <p>
      <span class="emphasis"><em>ifn1</em></span> - starting vector
      </p>
        <p>
      <span class="emphasis"><em>ifn2, ifn3,etc.</em></span> - vector after <span class="emphasis"><em>idurx</em></span> seconds
    </p>
        <p>
      <span class="emphasis"><em>idur1</em></span> - duration in seconds of first segment.
      </p>
        <p>
      <span class="emphasis"><em>idur2, idur3, etc. </em></span> - duration in seconds of subsequent segments.
    </p>
        <p>
      <span class="emphasis"><em>ielements</em></span> - number of elements of vectors.
      </p>
      </div>
      <div class="refsect1">
        <a id="idp164076752"></a>
        <h2>Performance</h2>
        <p>
      These opcodes are similar to <span class="emphasis"><em>linseg</em></span> and <span class="emphasis"><em>expseg</em></span>, but operate with vectorial signals instead of with scalar signals.
    </p>
        <p>
      Output is a vectorial control signal hosted by <span class="emphasis"><em>ifnout</em></span> (that must be previously allocated), while each break-point of the envelope is actually a vector of values. All break-points must contain the same number of elements (<span class="emphasis"><em>ielements</em></span>).
    </p>
        <p>
      All these operators are designed to be used together with other opcodes that operate with vectorial signals such as&gt;, <span class="emphasis"><em>vcella</em></span>, <span class="emphasis"><em>adsynt</em></span>, <span class="emphasis"><em>adsynt2</em></span>, etc. 
    </p>
      </div>
      <div class="refsect1">
        <a id="idp164082256"></a>
        <h2>Example</h2>
        <p>
      Here is an example of the vexpseg opcode. It uses the files <a class="ulink" href="examples/vexpseg.csd" target="_top"><em class="citetitle">vexpseg.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp164084112"></a>
          <p class="title">
            <strong>Example 997. Example of the vexpseg opcode.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
-odac -B441 -b441
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>


<span class="ohdr">sr</span><span class="op">=</span>44100
<span class="ohdr">ksmps</span><span class="op">=</span>10
<span class="ohdr">nchnls</span><span class="op">=</span>2

gilen <span class="opc">init</span> 32

gitable1 <span class="ohdr">ftgen</span> 0, 0, gilen, 10, 1
gitable2 <span class="ohdr">ftgen</span> 0, 0, gilen, 10, 1

gitable3 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 30, gilen, 35
gitable4 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 400, gilen, 450
gitable5 <span class="ohdr">ftgen</span> 0, 0, gilen, <span class="op">-</span>7, 5000, gilen, 5500

<span class="oblock">instr</span> 1
<span class="opc">vcopy</span> gitable2, gitable1, gilen
<span class="opc">turnoff</span>
<span class="oblock">endin</span>

<span class="oblock">instr</span> 2
<span class="opc">vexpseg</span> gitable2, 16, gitable3, 2, gitable4, 2, gitable5
<span class="oblock">endin</span>

<span class="oblock">instr</span> 3
kcount <span class="opc">init</span> 0
<span class="octrl">if</span> kcount <span class="op">&lt;</span> 16 then
	kval <span class="opc">table</span> kcount, gitable2
	<span class="opc">printk</span> 0,kval
	kcount <span class="op">=</span> kcount <span class="op">+</span>1
<span class="octrl">else</span>
<span class="opc">turnoff</span>
<span class="octrl">endif</span>

<span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">i</span>1 0 1
<span class="stamnt">s</span>
<span class="stamnt">i</span>2 0 10
<span class="stamnt">i</span>3 0 1
<span class="stamnt">i</span>3 1 1
<span class="stamnt">i</span>3 1.5 1
<span class="stamnt">i</span>3 2 1
<span class="stamnt">i</span>3 2.5 1
<span class="stamnt">i</span>3 3 1
<span class="stamnt">i</span>3 3.5 1
<span class="stamnt">i</span>3 4 1
<span class="stamnt">i</span>3 4.5 1

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp164086032"></a>
        <h2>Credits</h2>
        <p>Written by Gabriel Maldonado.</p>
        <p>Example by Andres Cabrera.</p>
        <p>New in Csound 5 (Previously available only on CsoundAV)</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="vexp_i.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="vexpv.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">vexp_i </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> vexpv</td>
        </tr>
      </table>
    </div>
  </body>
</html>
